
#pragma once

namespace reload
{
	class ReloadConnectionActorMgr;
	class ReloadOverlay;

	class ReloadAcceptActorMgr : public asyframe::AssignedSingleWorkerActorMgr
	{
	public:
		ReloadAcceptActorMgr(boost::weak_ptr<ReloadOverlay> _pReloadOverlay ,boost::shared_ptr<asyframe::WorkerBase> _pWorker, boost::shared_ptr<ReloadConnectionActorMgr> _pReloadConnectionActorMgr);
		virtual ~ReloadAcceptActorMgr();

		virtual retT makeActor(boost::shared_ptr<asyframe::ActorBase>& _pActor);

		boost::shared_ptr<ReloadConnectionActorMgr> getReloadConnectionActorMgr();
		virtual retT start();

	protected:
		boost::weak_ptr<ReloadConnectionActorMgr> pReloadConnectionActorMgr_;
		boost::weak_ptr<ReloadOverlay> pReloadOverlay_;
	};

	class ReloadAcceptActor : public asyframe::ActorBase, public virtual asyframe::IAcceptAction
	{
	public:
		ReloadAcceptActor(boost::weak_ptr<ReloadOverlay> _pReloadOverlay);
		virtual ~ReloadAcceptActor();

		virtual retT init();
		virtual retT onError(retT errorNo);
		virtual retT start();

		retT onAccept( boost::shared_ptr<asyframe::AcceptHandlerContext> _pAcceptHandlerContext, const boost::system::error_code& e, std::size_t _timeoutCount );
		retT acceptOne();

	protected:
		boost::shared_ptr<asyframe::AcceptHandler> pAcceptHandler_;
		boost::weak_ptr<ReloadOverlay> pReloadOverlay_;
	};
} /*namespace reload*/
